package com.xtz.service.impl;

import com.xtz.domain.Order;
import com.xtz.dto.PageDto;
import com.xtz.mapper.OrderMapper;
import com.xtz.service.OrderService;
import com.xtz.vo.OrderPageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * date: 2022/5/14 9:00
 *
 * @author xietianze
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public List<Order> getPage(PageDto dto) {
        Integer page = dto.getPage();
        String beginTime = dto.getBeginTime();
        Integer pageSize = dto.getPageSize();
        String number = dto.getNumber();
        String endTime = dto.getEndTime();
        page = (page - 1) * pageSize;
        return orderMapper.page(beginTime, endTime, number, page, pageSize);

    }

    @Override
    public Boolean updatestatusById(Integer status, String id) {
        return orderMapper.updatestatusById(status,id)>0;
    }
}
